const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: process.env.NODE_ENV === 'development' ? '/' : './',
  devServer: {
    host: '0.0.0.0',
    open: true,
    port: 8080
  },
  filenameHashing: true,
  css: {
    extract: true
  },
  chainWebpack: config => {
    config.resolve.alias.set('@', resolve('src'))
    config
      .plugin('html')
      .tap(args => {
        args[0].title = '实验室'
        return args
      })
  }
}